<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/vnd.microsoft.icon" href="http://www.gstatic.com/codesite/ph/images/phosting.ico">
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>KeyCpp -- A MATLAB-like library for C++: KeyCpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-42949208-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">KeyCpp -- A MATLAB-like library for C++
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">KeyCpp </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1>Ubuntu Users</h1>
<p>If using Ubuntu 13.04 or greater, you can install the KeyCpp library and all dependencies using the following commands:</p>
<p><code>sudo apt-add-repository ppa:jam4375/keycpp</code></p>
<p><code>sudo apt-get update</code></p>
<p><code>sudo apt-get install keycpp</code></p>
<h1><a class="anchor" id="usage"></a>Usage</h1>
<p><em>This library uses features only available in the <a href="https://en.wikipedia.org/wiki/C%2B%2B11">C++11 standard</a>. YOU MUST <a href="http://gcc.gnu.org/projects/cxx0x.html">COMPILE</a> WITH THIS STANDARD.</em></p>
<p>Download the example code: <a href="examples/example.cpp" onclick="_gaq.push([&apos;_trackEvent&apos;,&apos;Example&apos;,&apos;cpp&apos;,this.href]);" target="_blank">example.cpp</a>. In the directory that you saved the file, execute the following commands to compile and run the example:</p>
<p><code>g++ example.cpp -lkeycpp -lblas -llapack -std=c++11</code></p>
<p><code>./example</code></p>
<p>If everything is setup correctly, there should be no errors and the output should be the same as shown <a href="#output">below</a>.</p>
<h1><a class="anchor" id="alt_install"></a>Alternate Installation Instructions</h1>
<h2>Download Source</h2>
<p>Download the complete source and documentation: <a href="releases/keycpp-0.1.tar.gz" onclick="_gaq.push([&apos;_trackEvent&apos;,&apos;Download&apos;,&apos;tar.gz&apos;,this.href]);" target="_blank">keycpp-0.1.tar.gz</a>.</p>
<p>If you want the most up-to-date version you can download the source by cloning the git repository from <a href="http://code.google.com/p/keycpp/source/checkout">code.google.com/p/keycpp/</a>. It should be noted that the version on code.google.com may not be as stable as the compressed source file above.</p>
<p>After downloading the source, make sure you have the dependencies and follow the installation instructions below.</p>
<h2>Dependencies</h2>
<p>Currently this project makes use of the <a href="http://www.sourceforge.net/projects/kissfft/">Kiss FFT</a> and <a href="http://code.google.com/p/gnuplot-cpp/">gnuplot-cpp</a> open source projects as well as the <a href="http://www.netlib.org/lapack/">LAPACK</a> libraries, <a href="http://www.gnuplot.info/">Gnuplot</a> plotting program, and the <a href="http://www.boost.org/doc/libs/1_54_0/libs/numeric/odeint/doc/html/index.html">Boost odeint</a> library. The sources from <a href="http://www.sourceforge.net/projects/kissfft/">Kiss FFT</a> and <a href="http://code.google.com/p/gnuplot-cpp/">gnuplot-cpp</a> have been incorporated into this project.</p>
<p>The <em>only</em> extra dependencies that you need on your system are the <a href="http://www.netlib.org/lapack/">LAPACK</a> libraries, <a href="http://www.gnuplot.info/">Gnuplot</a>, and the <a href="http://www.boost.org/doc/libs/1_54_0/libs/numeric/odeint/doc/html/index.html">Boost odeint</a> library.</p>
<h3>Ubuntu (and various <a href="https://wiki.ubuntu.com/UbuntuFlavors">flavors</a>)</h3>
<p><em>NOTE: For permformance reasons, use of OpenBLAS/LAPACK is preferred over the default versions.</em></p>
<p>To acquire all the required dependencies you can execute the following commands:</p>
<p><code>sudo apt-get install build-essential</code></p>
<p><code>sudo apt-get install libboost-dev</code></p>
<p><code>sudo apt-get install libopenblas-dev</code></p>
<p><code>sudo apt-get install liblapack-dev</code></p>
<p>If using Ubuntu 13.04 or prior, you must download the source for <a href="http://www.odeint.com">odeint</a> and copy the directory <code>./boost/numeric/odeint</code> and file <code>./boost/numeric/odeint.hpp</code> to <code>/usr/include/boost/numeric/</code>.</p>
<h2>Installation</h2>
<p>To install KeyCpp onto your system first download the source <a href="releases/keycpp-0.1.tar.gz" onclick="_gaq.push([&apos;_trackEvent&apos;,&apos;Download&apos;,&apos;tar.gz&apos;,this.href]);" target="_blank">here</a> and extract to the directory of your choice:</p>
<p><code>tar -zxvf keycpp-0.1.tar.gz</code></p>
<p><code>cd ./keycpp</code></p>
<p>The following command will compile the KeyCpp library and provide links to the library and header files in Ubuntu's default location:</p>
<p><code>sudo ./INSTALL</code></p>
<p>To uninstall the KeyCpp library, use the following command:</p>
<p><code>sudo ./UNINSTALL</code></p>
<h3>Other Operating Systems</h3>
<p>This library has not been tested on operating systems other than Ubuntu yet. You should be able to get this library working on other linux distributions or OS X with slight modifications to the procedures above. Windows users may have a harder time getting this library to compile. For all operating systems, first make sure that you have all of the dependencies.</p>
<h1>Intel MKL</h1>
<p>For Intel processors, the <a href="http://software.intel.com/en-us/intel-mkl">Intel MKL</a> libraries provide the best performance. If you choose to use Intel's MKL libraries, the necessary compiler flags are:</p>
<p><code>g++ example.cpp -lkeycpp -L/$(MKLROOT)/lib/intel64 -lmkl_rt -std=c++11</code></p>
<p>or using the Intel C++ compiler:</p>
<p><code>icc example.cpp -lkeycpp -L/$(MKLROOT)/lib/intel64 -lmkl_rt -std=c++11</code></p>
<p>If writing parallel applications, especially using OpenMP, it is highly recommended to use the Inter C++ compiler. Using <code>g++</code>, OpenMP, and Intel MKL together sometimes produces undefined behavior.</p>
<h1><a class="anchor" id="example"></a>Example Code</h1>
<p><b><code>example.cpp</b></code> </p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &lt;keycpp/keycpp.h&gt;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="keyword">using namespace </span>keycpp;</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// Define a class for our ordinary differential equation that we will use later:</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="keyword">class </span><a class="code" href="class_ode_class.html">OdeClass</a></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;{</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;        <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> &amp;y,</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;                        <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> &amp;dy,</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;                        <span class="keyword">const</span> <span class="keywordtype">double</span>)</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;        {</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;            dy(0) = y(1)*y(2);</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;            dy(1) = -y(0)*y(2);</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;            dy(2) = -0.51*y(0)*y(1);</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;        }</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;};</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keywordtype">int</span> main()</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;{</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="comment">// First, lets create some data: y1 = t^2 and y2 = t^3</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> t = linspace(-2.0,2.0,100);</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> y1 = <a class="code" href="namespacekeycpp.html#a23a0fd48168263aad7f77f1769dc2f2a" title="Performs array multiplication on matrices A and B. ">times</a>(t,t);</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> y2 = <a class="code" href="namespacekeycpp.html#a23a0fd48168263aad7f77f1769dc2f2a" title="Performs array multiplication on matrices A and B. ">times</a>(t,<a class="code" href="namespacekeycpp.html#a23a0fd48168263aad7f77f1769dc2f2a" title="Performs array multiplication on matrices A and B. ">times</a>(t,t));</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="comment">// Now, lets plot the data we just created:</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <a class="code" href="classkeycpp_1_1_figure.html">Figure</a> h1;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    h1.plot(t,y1,<span class="stringliteral">&quot;b-&quot;</span>,<span class="stringliteral">&quot;linewidth&quot;</span>,2);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    h1.hold_on();</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    h1.plot(t,y2,<span class="stringliteral">&quot;r--&quot;</span>,<span class="stringliteral">&quot;linewidth&quot;</span>,2);</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    h1.grid_on();</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    h1.xlabel(<span class="stringliteral">&quot;t&quot;</span>);</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    h1.ylabel(<span class="stringliteral">&quot;y&quot;</span>);</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    h1.legend({<span class="stringliteral">&quot;y1 = t^2&quot;</span>,<span class="stringliteral">&quot;y2 = t^3&quot;</span>});</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    set(h1,<span class="stringliteral">&quot;fontsize&quot;</span>,14);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="comment">// This is how to solve linear equations of the form Ax = b:</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> A = {{1.0, 2.0},</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;                        {1.0,-1.0}};</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> b = {1.1,</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;                        2.1};</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> x = linsolve(A,<a class="code" href="namespacekeycpp.html#a7fd5ce0385e9cc7bed5b44ed8475e8aa" title="Returns the transpose of matrix A. ">transpose</a>(b));</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="comment">// Print the result to the screen:</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <a class="code" href="namespacekeycpp.html#af4a2245da139cf6cf2e03426476b3b88" title="Displays on standard output any parameter passed to it provided the operator &lt;&lt; is defined for its ty...">disp</a>(x);</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="comment">// Now lets do something a little more complicated, solve an</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="comment">// ordinary differential equation (ODE):</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="comment">// y(1)&#39; = y(2)*y(3);</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="comment">// y(2)&#39; = -y(1)*y(3);</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="comment">// y(3)&#39; = 0.51*y(1)*y(2);</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="comment">// With initial conditions at t = 0: y(1) = 0; y(2) = 1; y(3) = 1;</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <a class="code" href="class_ode_class.html">OdeClass</a> myOde;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> t2 = linspace(0.0,12.0,100);</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> ICs = {0.0, 1.0, 1.0};</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <a class="code" href="classkeycpp_1_1matrix.html">matrix&lt;double&gt;</a> y = ode45(myOde, t2, ICs);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    </div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="comment">// Now that we have solved the ODE, lets plot the results:</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="classkeycpp_1_1_figure.html">Figure</a> h2;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    h2.plot(t2,y.col(0),<span class="stringliteral">&quot;-&quot;</span>);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    h2.hold_on();</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    h2.plot(t2,y.col(1),<span class="stringliteral">&quot;-.&quot;</span>);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    h2.plot(t2,y.col(2),<span class="stringliteral">&quot;x&quot;</span>);</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    h2.xlabel(<span class="stringliteral">&quot;t&quot;</span>);</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    h2.ylabel(<span class="stringliteral">&quot;y&quot;</span>);</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    set(h2,<span class="stringliteral">&quot;fontsize&quot;</span>,14);</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    h2.title(<span class="stringliteral">&quot;ODE Solution&quot;</span>);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;}</div>
</div><!-- fragment --><p> <br/>
 <a class="anchor" id="output"></a> <b><code>Text</code> Output</b> </p>
<div class="fragment"></div><!-- fragment --><p> <br/>
 <b><code>Plot</code> Output</b> </p>
<div class="image">
<img src="plot1.png"  alt="First plot from the example program."/>
</div>
<p> <br/>
 </p>
<div class="image">
<img src="plot2.png"  alt="Second plot from the example program."/>
</div>
<p> <br/>
</p>
<h1>MATLAB/Octave to KeyCpp Conversion Chart</h1>
<p>Although the goal of this library is to offer a C++ interface similar in syntax to MATLAB/Octave, there are some minor differences. The goal of this document is to provide a conversion chart for some of the most commonly used features.</p>
<p>Note: You can omit the <code>keycpp::</code> prefix from the following commands by placing <code>using namespace keycpp;</code> in the same scope. This shortcut should be used with care as collisions with other libraries are possible.</p>
<table class="doxtable">
<tr>
<th><em>MATLAB/Octave</em> </th><th><em>KeyCpp</em> </th><th>Notes  </th></tr>
<tr>
<td><code>A(1,1)</code> </td><td><code>A(0,0);</code> </td><td>Indexing starts at 0 in KeyCpp </td></tr>
<tr>
<td><code>A(N,N)</code> </td><td><code>A(N-1,N-1);</code> </td><td></td></tr>
<tr>
<td><code>size(A,1)</code> </td><td><code>keycpp::size(A,1);</code> </td><td></td></tr>
<tr>
<td><code>size(A,2)</code> </td><td><code>keycpp::size(A,2);</code> </td><td></td></tr>
<tr>
<td><code>A(:,k)</code> </td><td><code>A.getCol(k-1);</code> </td><td>C++ restricts the use of <code>:</code> </td></tr>
<tr>
<td><code>A(k,:)</code> </td><td><code>A.getRow(k-1);</code> </td><td></td></tr>
<tr>
<td><code>A.'</code> </td><td><code>keycpp::transpose(A);</code> </td><td>C++ does not allow overloading <code>.'</code> </td></tr>
<tr>
<td><code>A'</code> </td><td><code>keycpp::ctranspose(A);</code> </td><td>C++ does not allow overloading <code>'</code> </td></tr>
<tr>
<td><code>A = zeros(m,n)</code> </td><td><code><a class="el" href="classkeycpp_1_1matrix.html">keycpp::matrix</a>&lt;double&gt; A = <a class="el" href="namespacekeycpp.html#a5699c522088657287bf0ac01173b716c" title="Returns a matrix of size M x N containing all zeros. ">keycpp::zeros</a>&lt;double&gt;(m,n);</code> </td><td>or more simply: <code><a class="el" href="classkeycpp_1_1matrix.html">keycpp::matrix</a>&lt;double&gt; A(m,n);</code> </td></tr>
<tr>
<td><code>A = ones(m,n)</code> </td><td><code><a class="el" href="classkeycpp_1_1matrix.html">keycpp::matrix</a>&lt;double&gt; A = <a class="el" href="namespacekeycpp.html#a388f91a0ccf34978ef9403ccd0c680bf" title="Returns a matrix of size M x N containing all ones. ">keycpp::ones</a>&lt;double&gt;(m,n);</code> </td><td></td></tr>
<tr>
<td><code>A.*B</code> </td><td><code>keycpp::times(A,B);</code> </td><td>C++ does not allow overloading <code>.*</code> or <code>./</code> </td></tr>
<tr>
<td><code>A./B</code> </td><td><code>keycpp::rdivide(A,B);</code> </td><td></td></tr>
<tr>
<td><code>A\b</code> </td><td><code>keycpp::linsolve(A,b);</code> </td><td><code>b</code> is a vector </td></tr>
<tr>
<td><code>[V, D] = eig(A,B)</code> </td><td><code>std::vector&lt;std::complex&lt;double&gt;&gt; d = keycpp::eig(A,B,&amp;V);</code> </td><td>Non-Hermitian generalized eigenvalue/eigenvector solver uses LAPACK. </td></tr>
<tr>
<td><code>x = linspace(0,10,N_x)</code> </td><td><code>std::vector&lt;double&gt; x = keycpp::linspace(0.0,10.0,N_x);</code> </td><td></td></tr>
<tr>
<td><code>x = logspace(1,3,N_x)</code> </td><td><code>std::vector&lt;double&gt; x = <a class="el" href="namespacekeycpp.html#a28626d0ffc4ecda3f9bc6e7b0f4fc4d2" title="Produces a vector containing N values logarithmically spaced between 10^(x1) and 10^(x2), inclusively. ">keycpp::logspace</a>(1.0,3.0,N_x);</code> </td><td><code>10 &lt;= x &lt;= 1000</code> </td></tr>
<tr>
<td><code>A = diag([a1, a2, a3])</code> </td><td><code><a class="el" href="classkeycpp_1_1matrix.html">keycpp::matrix</a>&lt;double&gt; A = keycpp::diag({a1, a2, a3});</code> </td><td><code>a1</code>, <code>a2</code>, and <code>a3</code> are scalar elements of <code>A</code> </td></tr>
<tr>
<td><code>A = [[a1, a2]; [a3, a4]]</code> </td><td><code><a class="el" href="classkeycpp_1_1matrix.html">keycpp::matrix</a>&lt;double&gt; A = {{a1, a2}, {a3, a4}};</code> </td><td></td></tr>
</table>
</div></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jan 2 2014 15:59:17 for KeyCpp -- A MATLAB-like library for C++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
